<template>
  <container >
    <div class="set-type">
      <div class="left-img">
        <img :src="src" alt="">
      </div>
      <div class="right-content">
        <ul>
          <li v-for="(item,index) of list" :key="index" @click="onJoinSetType(index)">
            <div class="title"><span class="deepGreen" v-if="index==0">创建</span><span class="blue" v-else>加入</span>{{item.title}}</div>
            <div class="text">{{item.content}}</div>
            <Icon type="ios-arrow-forward" class="right" />
          </li>
        </ul>
      </div>
    </div>
    <!-- 弹窗已选公司列表 -->
    <HasChoiceListItem ref="hasChoice"></HasChoiceListItem>
  </container>
</template>
<script>
import HasChoiceListItem from './edit/HasChoiceListItem'
export default {
  components: {
    HasChoiceListItem
  },
  data() {
    return {
      src: require("@/assets/images/company.jpg"),
      list: [{
        title: '团队',
        content: '创建企业/团队/组织,做维护管理员、邀请团队成员共同使用'
      }, {
        title: '团队',
        content: '你的同事也许也在使用，赶快加入团队一起协作办公吧'
      }]
    }
  },
  methods: {
    onJoinSetType(index) {
      if (index == 0) {
        this.$router.push({ name: 'company/setType/edit'})
      } else {
        this.$refs.hasChoice.open()
      }
    }
  }
}
</script>